<?php

use yii\helpers\Html;
//use yii\grid\GridView;
use kartik\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel common\models\ShippingSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '航运管理';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="shipping-index">

    <h1><?= Html::encode($this->title) ?></h1>

    <p>
        <?= Html::a('从Excel表格导入数据', ['import'], ['class' => 'btn btn-success','title'=>'本操作会将之前的数据清除']) ?>
        <span class="help-block inline">本操作会将之前的数据清除</span>
    </p>

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'tableOptions'=> ['class'=>'table-bordered'],
        'beforeHeader' => [
            [
                'columns' => [
                    [],
                        [
                        ],[],[],[],[],[],[],[],
                    ['content' => '20\'st', 'options' => ['colspan' => 4, 'class' => 'text-center ']],
                    ['content' => '40\'st', 'options' => ['colspan' => 4, 'class' => 'text-center ']],
                    ['content' => '40\'HQ', 'options' => ['colspan' => 4, 'class' => 'text-center ']],
                    ['content' => '45\'GQ', 'options' => ['colspan' => 4, 'class' => 'text-center ']],
                    [],[],[],
                ],
            ]
        ],
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            //'id',
           'berth',
            'company',
            'SPOT',
            'POL',
            'POD',
            'BOOKING_NO',
            'PCD',
            'ETD',

            'QTY_20ST',
            'BAS_20ST',
            'extra_price_20ST',
            'total_price_20ST',

            'QTY_40ST',
            'BAS_40ST',
            'extra_price_40ST',
            'total_price_40ST',

            'QTY_40HQ',
            'BAS_40HQ',
            'extra_price_40HQ',
            'total_price_40HQ',

            'QTY_45GQ',
            'BAS_45GQ',
            'extra_price_45GQ',
            'total_price_45GQ',
            'mem',
            'distance',
            'line',
            'sailing_date',

            [
                'class' => 'yii\grid\ActionColumn',
                'header'=>'操作',
                'template'=>'{delete}'
            ],
        ],
        'emptyText'=>'没有数据，请导入',
       // 'layout'=>'{items}{pager}'
    ]); ?>


</div>
